package com.example.customdialog;

import android.app.Dialog;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void showDialog(View view) {
        new CustomAlertDialog(this)
                .setButtonBackgroundResource(R.drawable.rounded_button_bg_green)
                .setTitleText("通知")
                .setMessageText("消息消息")
                .setTextColor(Color.argb(255,60,179,113))
                .setOnClickListener(new CustomAlertDialog.OnClickListener() {
                    @Override
                    public void onClick(Dialog dialog) {
                        dialog.dismiss();
                    }
                })
                .show();
    }

    public void showDialog2(View view) {
        new CustomAlertDialog(this)
                .setButtonBackgroundResource(R.drawable.rounded_button_bg_blue)
                .setTitleText("提示")
                .setMessageText("消息消息")
                .setTextColor(Color.argb(255,135,206,250))
                .show();
    }
}
